﻿@inherits AntDesignTestBase

@code {

  [Theory]
  [InlineData(BadgeColor.Pink)]
  [InlineData(BadgeColor.Red)]
  [InlineData(BadgeColor.Yellow)]
  [InlineData(BadgeColor.Orange)]
  [InlineData(BadgeColor.Cyan)]
  [InlineData(BadgeColor.Green)]
  [InlineData(BadgeColor.Blue)]
  [InlineData(BadgeColor.Purple)]
  [InlineData(BadgeColor.Geekblue)]
  [InlineData(BadgeColor.Magenta)]
  [InlineData(BadgeColor.Volcano)]
  [InlineData(BadgeColor.Gold)]
  [InlineData(BadgeColor.Lime)]
  public void ItShouldRenderBadgeWithColors(string color)
  {
    var cut = Render<Badge>(@<Badge Color="@color"></Badge> );
    cut.MarkupMatches(@<span class="ant-badge ant-badge-status ant-badge-not-a-wrapper" id:ignore>
        <span class="ant-badge-status-dot" style="background: @color; "></span>
      </span>);
  }

  [Theory]
  [MemberData(nameof(inlineData))]
  public void ItShouldRenderBadgeWithPresetColors(PresetColor color)
  {
    var cut = Render<Badge>(@<Badge PresetColor="@color"></Badge> );
    var persetColor = Enum.GetName(typeof(PresetColor), color).ToLowerInvariant();
    cut.MarkupMatches(@<span class="ant-badge ant-badge-status ant-badge-not-a-wrapper" id:ignore>
        <span class="ant-badge-status-dot ant-badge-status-@persetColor" style=""></span>
      </span>
        );
    }

    public static IEnumerable<object[]> inlineData => Enum.GetValues<PresetColor>().Select(x => new object[] { x });
}
